<include file="Public/header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>全局设置</h4>
		<div class="bs-example-bg-classes">
			<p class="bg-warning">
			说明：PC端访问首页显示的模板样式；<br/>
			固定页面：页面样式固定，无法更改，只可添加栏目和单页<br/>
			自定义页面：页面样式可自由发挥
			</p>
		</div>
		<form class="form-horizontal" id="myform">
			<div class="form-group">
				<label for="cat_name" class="col-sm-2 control-label">PC访问</label>
				<div class="col-sm-3">
					<select name="PcSetting" id="" class="form-control">
						<option value="index" <if condition="$res['pcsetting'] == 'index'">selected="selected"</if>>原始页面</option>
						<option value="custom_index" <if condition="$res['pcsetting'] == 'custom_index'">selected="selected"</if>>自定义页面</option>
					</select>
				</div>
			</div>
			
			<!-- <div class="form-group">
				<label class="col-sm-2 control-label">手机访问</label>
				<div class="col-sm-3">
					<select name="MobileSetting" id="" class="form-control">
						<option value="mobile" <if condition="$res['mobilesetting'] == 'mobile'">selected="selected"</if>>手机端</option>
						<option value="pc" <if condition="$res['mobilesetting'] == 'pc'">selected="selected"</if>>PC站</option>
					</select>
				</div>
			</div> -->
			
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="button" class="btn btn-default col-sm-2" onclick="SaveSetting()">保存</button>
				</div>
			</div>
		</form>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>


function SaveSetting(){

	var ajaxUrl = "<{:U('Admin/Global/SaveSetting')}>";
	$.post(ajaxUrl,$('form').serialize(),function(r){
		if (r.error == 1){
			layer.msg(r.msg,{icon: 2});
		}else{
			layer.msg(r.msg,{icon: 1});
			setTimeout(function(){window.location.reload()},1000);
		}
		return false;
	});
	return false;
}

			 
</script>

<include file="Public/footer" /> 